gtk/: Fix build without PangoFT2 and HarfBuzz
authorChun-wei Fan <fanchunwei@src.gnome.org>
Wed, 20 Jun 2018 10:13:44 +0000 (18:13 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Tue, 26 Jun 2018 08:40:18 +0000 (16:40 +0800)
On Windows HarfBuzz and PangoFT2 are optional, so we need to ensure that
we only build the bits that require HarfBuzz and PangoFT2 when needed.
We may need to see later whether we can get the needed functionality in
gtkfontchooserwidget.c with the Windows APIs without the need of
HarfBuzz nor PangoFT2 (and starting programs on Windows using FontConfig
is very slow).

gtk/gtkfontchooserwidget.c
gtk/language-names.c
gtk/script-names.c

index b34f28fcda8843d60503cda855d65b3a65077864..b858d92c29f805907f890ab251fc164fd9d87e60 100644 (file)
@@ -862,7 +862,9 @@ gtk_font_chooser_widget_init (GtkFontChooserWidget *fontchooser)
 
   /* Load data and set initial style-dependent parameters */
   gtk_font_chooser_widget_load_fonts (fontchooser, TRUE);
+#if defined(HAVE_HARFBUZZ) && defined(HAVE_PANGOFT)
   gtk_font_chooser_widget_populate_features (fontchooser);
+#endif
   gtk_font_chooser_widget_set_cell_size (fontchooser);
   gtk_font_chooser_widget_take_font_desc (fontchooser, NULL);
 }
index 6fa6eaa2f2cf98a0f3798a337e41a62eb43e3a20..571dc67c0d0154b7591535455cf32872563466c0 100644 (file)
@@ -15,6 +15,8 @@
 #include <glib.h>
 #include <glib/gi18n.h>
 #include <glib/gstdio.h>
+
+#if defined (HAVE_HARFBUZZ) && defined (HAVE_PANGOFT)
 #include <hb-ot.h>
 
 #include "language-names.h"
@@ -237,3 +239,4 @@ get_language_name_for_tag (guint32 tag)
 
   return get_language_name (pango_language_from_string (s));
 }
+#endif
index 216fd40f5a761dc11eb9b2fdb74dbb8bb2437a5b..394c888aaf7f8785c6bbb964c121b87f7356a3ba 100644 (file)
@@ -1,6 +1,8 @@
 #include "config.h"
 #include <glib.h>
 #include <glib/gi18n-lib.h>
+
+#if defined (HAVE_HARFBUZZ) && defined (HAVE_PANGOFT)
 #include <hb-ot.h>
 
 #include "script-names.h"
@@ -182,3 +184,4 @@ get_script_name_for_tag (guint32 tag)
 
   return NULL;
 }
+#endif